package com.eposi.eposigameinterface.adapter;

import com.eposi.eposigameinterface.R;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.CheckBox;
import android.widget.TextView;

public class SubRulePlayAdapter extends BaseAdapter{
	Context ctx;
	LayoutInflater mInflater;
	
	public SubRulePlayAdapter(Context ctx) {
		this.ctx = ctx;
		mInflater = (LayoutInflater) ctx.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
	}
	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return 20;
	}

	@Override
	public Object getItem(int arg0) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		RuleHolder holder;
		if (convertView == null) {
			holder = new RuleHolder();
			convertView = mInflater.inflate(R.layout.list_rule_item, null);
			holder.textView = (TextView) convertView.findViewById(R.id.list_rule_text_view);
			holder.checkbox= (CheckBox) convertView.findViewById(R.id.list_rule_check_box);
			convertView.setTag(holder);
		}else{
			holder = (RuleHolder) convertView.getTag();
		}
		holder.textView.setText("Luật " + position);
		return convertView;
	}
	class RuleHolder{
		TextView textView;
		CheckBox checkbox;
	}

}
